import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);
export default new Router({
  mode: 'hash',
  base: '',
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/home',
      component: resolve => require(['../components/Home.vue'], resolve),//主页模块内容 顶部的导航栏 左边的侧边栏
      children: [
        {
          path: "/overview",
          name: "overview",
          component: resolve => require(["../page/overview.vue"], resolve) //概述
        },
        {
          path: "/equipment",
          name: "equipment",
          component: resolve => require(["../page/equipment.vue"], resolve) //设备
        },
        {
          path: "/category/:type",
          name: "category",
          component: resolve => require(["../page/category.vue"], resolve) //分类分组
        },
        {
          path: '/newCategory/:status/:targetId',
          name: "newCategory",
          component: resolve => require(["../page/newCategory.vue"], resolve) //新增编辑分类
        },
        {
          path: '/newSubclass/:parentId/:status/:currentId',
          name: "newSubclass",
          component: resolve => require(["../page/newSubclass.vue"], resolve) //新增编辑子分类
        },
        {
          path: '/newGroup/:status/:targetId',
          name: "newGroup",
          component: resolve => require(["../page/newGroup.vue"], resolve) //新增分组
        },
        {
          path: '/newChildGroup/:parentId/:status/:currentId',
          name: "newChildGroup",
          component: resolve => require(["../page/newChildGroup.vue"], resolve) //新增子组
        },
        {
          path: "/goods/:type",//商品
          name: "goods",
          component: resolve => require(["../page/goods.vue"], resolve),
        },
        {
          path: "/goodsDetail/:goodsId",
          name: "goodsDetail",
          component: resolve => require(["../page/goodsDetail.vue"], resolve) //商品详情
        },
        {
          path: "/order/:type",
          name: "order",
          component: resolve => require(["../page/order.vue"], resolve) //订单
        },
        {
          path: "/orderDetail/:orderType/:orderId",
          name: "orderDetail",
          component: resolve => require(["../page/orderDetail.vue"], resolve) //商品详情
        },
        {
          path: "/user/:type",
          name: "user",
          component: resolve => require(["../page/user.vue"], resolve) //用户
        },
        {
          path: "/task/:type",
          name: "task",
          component: resolve => require(["../page/task.vue"], resolve) //用户
        },
        {
          path: "/application/:type",
          name: "application",
          component: resolve => require(["../page/application.vue"], resolve) //应用
        },
        {
          path: "/marketing/:type/detail",
          name: "detail",
          component: resolve => require(["../page/detail.vue"], resolve) //营销详情
        },
        {
          path: "/marketing/:type",
          name: "marketing",
          component: resolve => require(["../page/marketing.vue"], resolve) //营销
        },
        {
          path: "/xiaoxiaole/:type",
          name: "xiaoxiaole",
          component: resolve => require(["../page/xiaoxiaole.vue"], resolve) //概述
        },
        {
          path: "/account",
          name: "account",
          component: resolve => require(["../page/account.vue"], resolve) //帐号
        },
        {
          path: "/statis/:type",
          name: "statis",
          component: resolve => require(["../page/statis.vue"], resolve) //统计
        },
        {
          path: "/cooperation/:type",
          name: "cooperation",
          component: resolve => require(["../page/cooperation.vue"], resolve) //统计
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: resolve => require(['../page/login.vue'], resolve)
    },
  ],
})
